<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@page import="com.hz.util.ParamUtil"%>
<%@page import="com.hz.control.UserControl"%>
<%@page import="com.hz.model.User"%>
<%@page import="com.hz.control.ParamDepartmentManager"%>
<%@page import="com.hz.control.ParamSpecialManage"%>
<%@page import="com.hz.control.HobbyControl"%>
<!DOCTYPE HTML>
<html>
  <head>
    <title>个人信息</title>
 	<meta charset="utf-8"/>
	<link rel="stylesheet" type="text/css" href="../../css/info.css"/>
	<script type="text/javascript" src="../../js/core.js"></script>
	<script type="text/javascript" src="../../js/show.js"></script>
	<script type="text/javascript">
        var popUpWin = 0;
        function PopUpWindow(URLStr, left, top, width, height, newWin, scrollbars) {
            if (typeof (newWin) == "undefined")
                newWin = false;

            if (typeof (left) == "undefined")
                left = 100;

            if (typeof (top) == "undefined")
                top = 0;

            if (typeof (width) == "undefined")
                width = 800;

            if (typeof (height) == "undefined")
                height = 760;

            if (newWin) {
                open(URLStr, '', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=' + scrollbars + ',resizable=yes,copyhistory=yes,width=' + width + ',height=' + height + ',left=' + left + ', top=' + top + ',screenX=' + left + ',screenY=' + top + '');
                return;
            }
            if (typeof (scrollbars) == "undefined") {
                scrollbars = 0;
            }
            if (popUpWin) {
                if (!popUpWin.closed) popUpWin.close();
            }
            popUpWin = open(URLStr, 'popUpWin', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=' + scrollbars + ',resizable=yes,copyhistory=yes,width=' + width + ',height=' + height + ',left=' + left + ', top=' + top + ',screenX=' + left + ',screenY=' + top + '');
            popUpWin.focus();
        }
</script>
  </head>
  <body>
  <%
		  request.setCharacterEncoding("utf-8");
		  User cu = (User)session.getAttribute("user");//当前用户
		  int uid = ParamUtil.getInt(request,"userid",(Integer)session.getAttribute("userid"));
		  User u = UserControl.getUserInformation(uid);//所显示的用户
  %>
  <h1 class='title pr'>个人信息
  <%
     if(cu!=null&&uid==cu.getId()){
  %><a href ="info_update.jsp">修改</a><%} %>
  </h1>
    <%    
         
          String Picurl = (String) session.getAttribute("picUrl");
	      	if (Picurl == null) {
	      		Picurl = u.getPicPath();
	      	}
         
     %>
   <form>
	<div class='sec'>
		<div class='content pr'>
			<table>
				<tr>
					<td class='c' width='130'>姓名</td>
					<td style="text-align: center;"><%=u.getRealname() %></td>
					<td colspan='2' rowspan='8' width='180'><img src='../../resources/photos/<%=Picurl%>' width='170' height='220'/>
					<br/><%if(cu!=null&&cu.getId()==uid){ %><a href="javascript:void(0);PopUpWindow('../register/uploadimage.jsp?Picurl=<%=Picurl%>',100,100,600,500);">修改头像</a><%} %></td>
				</tr>
				<tr>
					<td class='c' >性别</td>
					<td><%if(u.getSex()==0)out.print("女");else out.print("男"); %></td>
				</tr>
				<tr>
					<td class='c' >出生日期</td>
					<td><%=u.getBirthday() %></td>
				</tr>
				<tr>
					<td class='c' >籍贯</td>
					<td ><%=u.getBirthPlace()%></td>
				</tr>
				<tr>
					<td class='c' >身份证号</td>
					<td><%=u.getIdCard()%></td>
				</tr>
				<tr>	
					<td class='c'  width='20%'>学历</td>
					<td><%if(u.getStuLevel()==0) out.print("本科生");else{out.print("研究生");} %></td>
				</tr>
				<tr>
				<td class='c'  >学号</td>
					<td><%=u.getStuNum() %></td>
				</tr>
				<tr>
					<td class='c' >学院/专业</td>
					<td><%=ParamDepartmentManager.findDepartment(u.getDepartmentId()).getDepartmentSmallName() %>/<%=ParamSpecialManage.getSpecialById(u.getMajorId()).getSpecialName() %></td>
				</tr>
				<tr>
					<td class='c' >年级</td>
					<td  colspan='3'><%=u.getGrade() %></td>
				</tr>
				<tr>
				<td class='c' >电话</td>
					<td colspan='3'><%=u.getTel() %></td>
				</tr>
				<tr>
					<td class='c' >QQ</td>
					<td colspan='3'><%=u.getQq() %></td>
				</tr>
				<tr>
					<td class='c' width='20%'>E-mail</td>
					<td colspan='3'><%=u.getEmail() %></td>
				</tr>
				
				<tr>
					<td class='c' >志愿者星级</td>
					<td colspan='3'><em id='num'><%=u.getVolunteerLev() %></em><i><b class='star pa'></b></i><i><b class='star pa'></b></i><i><b class='star pa'></b></i><i><b class='star pa'></b></i><i><b class='star pa'></b></i></td>
				</tr>
				<tr>
				<td class='c' >志愿者编号</td>
					<td colspan='3'><%=u.getVolunteerNo() %></td>
					
				</tr>
				<tr>
					<td colspan='1' class='c' >志愿者服务类型</td>
					<td colspan='3'><%
				       if(u.getHobby()!=null){
				              StringTokenizer commaToker = new StringTokenizer(u.getHobby(), "@");
				              while(commaToker.hasMoreElements()){
					          out.println(HobbyControl.getHobbyName(Integer.parseInt(commaToker.nextToken()))+" ");
					      }
				        }else{
				        	out.print("暂无");
				        }
				   %></td>
				   </tr>
				   <tr>
					<td colspan='1' class='c' >曾获校级以上荣誉</td>
					<td colspan='3'><%=u.getAward() %></td>
				</tr>
				<tr>
				<td colspan='1' class='c'  width='130'>志愿者经历</td>
					<td colspan='3'><%=u.getVolunteerExp() %></td>
				</tr>
			</table>
	    </div>
	</div>
	<!-- <div class='sec'>
		<h2 class='btn'>在红烛参与过的活动</h2>
		<div class='content'>
		<iframe width="100%" scrolling="auto" height="400px;" frameborder="0"  src="../common/activity/myactivities.jsp?uid=<%=uid %>" style="height:400px; width:100%;" allowtransparency="true"></iframe>
	   </div>
	</div> -->
	<div id="mask"></div>
	<div id="dialog">
	    <div class="init">
	    <h1>密码修改<span id="cloBtn"></span></h1>
	    <iframe frameborder='0' width='400' height='300' src='../user/pwd_update.jsp'></iframe>
	    </div>
	</div>
   </form>
  </body>
</html>
